//
//  BaseMapViewController.m
//  SearchV3Demo
//
//  Created by songjian on 13-8-14.
//  Copyright (c) 2013年 songjian. All rights reserved.
//

#import "BaseMapViewController.h"
@interface BaseMapViewController()
@end

@implementation BaseMapViewController
@synthesize mapView = _mapView;

#pragma mark - Utility

- (void)clearMapView
{
    self.mapView.showsUserLocation = NO;
    [self.mapView removeAnnotations:self.mapView.annotations];
    [self.mapView removeOverlays:self.mapView.overlays];
    self.mapView.delegate = nil;
    self.mapView =nil;
}
#pragma mark - AMapSearchDelegate

- (void)AMapSearchRequest:(id)request didFailWithError:(NSError *)error
{
    NSLog(@"%s: searchRequest = %@, errInfo= %@", __func__, [request class], error);
}

#pragma mark - Initialization

- (void)initMapView
{
    
}
-(MAPointAnnotation *) Annotation{
    if(!_Annotation){
        _Annotation =[[MAPointAnnotation alloc]init];
    }
    return _Annotation;
}
-(void)addAnnotationWithCooordinate:(CLLocationCoordinate2D)coordinate
{
    self.Annotation.coordinate = coordinate;
    self.Annotation.title    = @"AutoNavi";
    self.Annotation.subtitle = @"CustomAnnotationView";
    [self.mapView addAnnotation:self.Annotation];
}
#pragma mark - Life Cycle

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    _isFirstAppear = YES;
    [self initMapView];
}

@end
